﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using zielonka.co.uk.test.framework.time;

namespace zielonka.co.uk.extensions.system.tests
{
    [TestClass]
    public class GetSubStringTests
    {
        //TODO:Add exception expected tests

        [TestMethod]
        public void CorrectlyGetSubStringInMidString()
        {
            string expected = "DEXY";
            string actual = "ABCDEXYZIJK".GetSubString("D", "Z", true);
            Assert.AreEqual(expected,actual);
        }

        //TODO:Does not allow an empty start string. I think this should be all text upto the located string.        
        [TestMethod]
        public void CorrectlyGetSubStringFromStartString()
        {
            string expected = "ABCD";
            string actual = "ABCDEXYZIJK".GetSubString("", "E", true);
            Assert.AreEqual(expected, actual);
        }

        //TODO:Does not allow an empty end string. I think this should be all text from the located string.
        [TestMethod]
        public void CorrectlyGetSubStringFromStartStringWithNoEnd()
        {
            string expected = "YZIJK";
            //TODO:Overload the method to not provide an end string or start string?
            string actual = "ABCDEXYZIJK".GetSubString("Y", "", true);

            Assert.AreEqual(expected, actual);
        }

        //TODO:Add tests for case invariants
    }
}
